{if $tabbed == "false"}
<h1>{t 1=$user->getLabel()}%s user edition{/t}</h1>
<div id="moduleTabs">
   <ul>
   	  {hasRight rule='users_Edit '|cat:$user->getUniqueId()}
      <li><a href="{$URL_RELATIVE}/bo/#{$user->getEditUrl($user->getLang(),'properties')}" title="Propriétés"><span>{t}Properties{/t}</span></a></li>
   	  {/hasRight}
   	  {hasRight rule=rights_Show}
      <li><a href="{$URL_RELATIVE}/bo/#{$user->getEditUrl($group->getLang(),'roles')}" title="{t}Roles{/t}" rel="history"><span>{t}Roles{/t}</span></a></li>
   	  <li><a href="{$URL_RELATIVE}/bo/#{$user->getEditUrl($group->getLang(),'rights')}" title="{t}Rights{/t}" rel="history"><span>{t}Rights{/t}</span></a></li>
      {/hasRight}
   </ul>
</div>
<div id="ajaxTabLoader"><div id="loaderTabPic">{backend_image file="ajax-loader-big.gif"}</div></div>
{/if}

<div id="tabContent">
	{if $tabNameUser=="roles"}
	{hasRight rule="rights_Show"}
		{block module="rights" action="listRoles" docId=$user->getUniqueId() docLang=$user->getLang()}
	{/hasRight}
	{elseif $tabNameUser=="rights"}
	{hasRight rule="rights_Show"}
		{block module="rights" action="listRights" docId=$user->getUniqueId() docLang=$user->getLang()}
	{/hasRight}
    {else}
	{hasRight rule='users_Edit '|cat:$user->getUniqueId()}
    <div id="saveButton"><div class="saveButtonMid">
        <ul class="saveButtons">
            <li class="first">
                <a href="{$URL_RELATIVE}/bo/#{$user->getGroupEditUrl()}" class="reload active" title="">
                    {icon name="menu_up.png" title=""} {t}Users list{/t}
                </a>
            </li>
        </ul>
    </div></div>
	<div id="formStatus">{if isset($errors.status)}{$errors.status}{/if}</div>
	<form name="FormUsers" method="post" action="?module=users&action=block_UserEdit&docId={$user->getUniqueId()}&docLang={$user->getLang()}">
		<div class="submitButton"><button type="reset" class="greyButton" >{t}Cancel{/t}</button> <button type="submit" name="FormUsers[submit]" class="greenButton" >{t}Save{/t}</button></div>
		<table class="listTable">
            <tr>
                <td>{t}Status{/t}</td>
                <td>
                {if $su->getUniqueId() == $user->getUniqueId()}
                    {t}ACTIVATED (Main user){/t}
                {else}
                    <select name="FormUsers[status]" id="statusSelectBox">
                        <option value="DRAFT" {if $user->getPublicationstatus() == "DRAFT"}selected="selected"{/if}>{t}Deactived{/t}</option>
                        <option value="PUBLISHED" {if $user->getPublicationstatus() == "PUBLISHED"}selected="selected"{/if}>{t}Activated{/t}</option>
                    </select>
                {/if}
                </td>
            </tr>
			<tr><td>{t}Login{/t}</td><td><input type="hidden" name="FormUsers[id]" value="{$user->getUniqueId()}"/>{$user->getLogin()}</td></tr>
            {hasRight rule='users_ChangePassword '|cat:$user->getUniqueId()}
			<tr>
				<td>{t}Password{/t}</td>
				<td><a href="{$URL_RELATIVE}/bo/#/users/changePassword/{$user->getUniqueId()}" class="nyroModal greyButton">{if $user->getUniqueId() == $currentUser->getUniqueId()}{t}Change the password{/t}{else}{t}Reinit the password{/t}{/if}</a></td>
            </tr>
            {/hasRight}
			<tr>
		      <td><label>{t}Email{/t}*</label></td>
		      <td><input type="text" name="FormUsers[mail]" value="{$user->getEmail()}" style="width:300px" /></td>
		      {if isset($errors.mail) && count($errors.mail) > 0}<td>{foreach from=$errors.mail item=error}<span>{$error}</span><br/>{/foreach}</td>{/if}
		    </tr>
            {if count($displayLangs) > 1}
            <tr>
                <td><label>{t}Back-office language{/t}</label></td>
                <td>
                    <select name="FormUsers[culture]">
                        {foreach from=$displayLangs item=lang}
                        <option value="{$lang.id}" {if $lang.id==$currentLang}selected="selected"{/if}>{$lang.label}</option>
                        {/foreach}
                    </select>
                </td>
            </tr>
            {/if}
            <tr>
                <th colspan="2">{t}Address{/t}</th>
            </tr>
			<tr>
		      <td><label>{t}Lastname{/t}</label></td>
		      <td><input type="text" name="FormUsers[nom]" value="{$user->getLastname()}" style="width:200px" /></td>
		      {if isset($errors.nom) && count($errors.nom) > 0}<td>{foreach from=$errors.nom item=error}<span>{$error}</span><br/>{/foreach}</td>{/if}
		    </tr>
		    <tr>
		      <td><label>{t}Firstname{/t}</label></td>
		      <td>
		      	<input type="text" name="FormUsers[prenom]" value="{$user->getFirstname()}" style="width:200px"/>
		      </td>
		      {if isset($errors.prenom) && count($errors.prenom) > 0}<td>{foreach from=$errors.prenom item=error}<span>{$error}</span><br/>{/foreach}</td>{/if}
		    </tr>
            <tr>
                <th colspan="2">{t}Properties{/t}</th>
            </tr>
			<tr><td>{t}Login{/t}</td><td>{$user->getUniqueId()}</td></tr>
			<tr><td>{t}Creator{/t}</td><td>{$user->getAuthor()}</td></tr>
            <tr><td>{t}Subscription date{/t}</td><td>{date date=$user->getCreationDate()}</td></tr>
			<tr><td>{t}Last modification{/t}</td><td>{date date=$user->getModificationDate()}</td></tr>
		</table>
	</form>
	{/hasRight}
	{/if}
</div>